package com.ymh.spring.learn.web.config;

import java.util.regex.Pattern;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.core.type.filter.RegexPatternTypeFilter;

import com.ymh.spring.learn.web.Flag;
import com.ymh.spring.learn.web.config.RootConfig.WebPackage;

/**
 * 
 * 
 * 名称：RootConfig<br/>
 * 描述：配置类加载的是驱动应用后端的中间层和数据层组件，是父上下文<br/>
 * 创建时间：2018年3月27日 上午11:26:03 <br/>
 * 
 * @author aivin
 * @version 1.0.0
 */
@Configuration
@Import(value = { DataConfig.class })
@ComponentScan(basePackageClasses = { Flag.class }, excludeFilters = { @Filter(type = FilterType.CUSTOM, value = WebPackage.class) })
public class RootConfig {

	public static class WebPackage extends RegexPatternTypeFilter {

		public WebPackage(Pattern pattern) {
			super(Pattern.compile("com.ymh.spring.learn.web.controller"));
		}

	}

}
